package cn.topevery.garden.dal.logic;

import cn.topevery.garden.dal.dao.RubbishBinCurDao;
import cn.topevery.garden.entity.po.RubbishBinCur;
import cn.topevery.garden.entity.query.RubbishBinCurQuery;
import cn.topevery.garden.entity.vo.RubbishBinCurVO;
import cn.topevery.garden.framework.base.BaseLogic;
import hw.topevery.framework.db.base.BaseEntityDao;
import hw.topevery.framework.db.entity.DataPager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 垃圾桶当前状态表
 *
 * @author code-generate
 * @date 2021-09-06
 */
@Service
public class RubbishBinCurLogic extends BaseLogic<RubbishBinCur> {
    @Autowired
    RubbishBinCurDao rubbishBinCurDao;

    @Override
    public BaseEntityDao<RubbishBinCur, Integer> getDao() {
        return rubbishBinCurDao;
    }

    

    /**
     * 获取列表
     *
     * @param query
     */
    public DataPager<RubbishBinCurVO> listPage(RubbishBinCurQuery query) {
        return rubbishBinCurDao.listPage(query);
    }

    /**
     * 根据自增id批量删除
     *
     * @param ids
     */
    public void deleteBatchById(String userId,Integer[] ids) {
        rubbishBinCurDao.delete(userId, ids);
    }

    /**
     * 根据自增id保存或者更新
     *
     * @param rubbishBinCur 实体
     */
    public void saveOrUpdate(String userId, RubbishBinCur rubbishBinCur){
        rubbishBinCurDao.saveOrUpdate(userId,rubbishBinCur);
    }

    public RubbishBinCur getByTemId(String temId) {
        return rubbishBinCurDao.getByTemId(temId);
    }

    /**
     * 根据自定义列值来获取对象
     */
    public RubbishBinCur getEntityByColumn(String key, String value) {
        return rubbishBinCurDao.getEntityByColumn(key, value);
    }
}
